package com.canaan.business.common.enums.inOutStock;

public enum InOrderStatusEnum {
    NEW(1, "新建"),
    PICKING(2, "码货中"),
    ACCOMPLISH(3, "完成"),
    CANCEL(4, "已取消"),
    CANCEL_PENDING_CONFIRMATION(5, "取消待确认"),
    DISTRIBUTE(6, "分配中"),
    ;

    private final Integer code;
    private final String message;

    InOrderStatusEnum(Integer code, String info)
    {
        this.code = code;
        this.message = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


    public static String getMessageByCode(Integer code){
        if(code == null){
            return null;
        }
        String message = null;
        for (InOrderStatusEnum value : values()) {
            if(value.getCode().equals(code)){
                message = value.getMessage();
                break;
            }
        }
        return message;
    }
}
